//拿到位置的id
import { L_request } from './request.js'

export function Getposionid() {
	return L_request({
		url: 'admin/staff/Getposionid',
		method: 'get',
	})
}

export function StaffAdd(adaData) {
	// 员工添加
	return L_request({
		url: 'admin/staff/add',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-from-urlencoded',
		},
		data: {
			Acc: adaData.Acc,
			password: adaData.password,
			UserName: adaData.UserName,
			position: adaData.position,
		},
	})
}
// 员工管理查找数据
export function StaffManage(serchdata) {
	return L_request({
		url: 'admin/staff/select',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-from-urlencoded',
		},
		data: { serchdata: serchdata.content },
	})
}
//员工修改
export function Staffedit(edits) {
	return L_request({
		url: 'admin/staff/edit',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-from-urlencoded',
		},
		data: {
			id: edits.id,
			nickname: edits.nickname,
			acc: edits.acc,
			pwd: edits.pwd,
			position: edits.position,
		},
	})
}
export function Staffdel(id) {
	return L_request({
		url: 'admin/staff/del',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-from-urlencoded',
		},
		data: { id: id },
	})
}
// 搜索打印内容
export function Searchcontent(serchdata) {

	// return;
	return L_request({
		url: 'admin/staff/select',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-from-urlencoded',
		},
		data: { serchdata: serchdata.content },
	})
}

export function geHone(acc) {
	return L_request({
		url: 'index/staff/login',
		method: 'post',
		params: {
			// acc:'kuangw3'
		},
		data: {
			acc: 'kuangw2',
		},
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded',
		},
	})
}

export function Admin_categoryGetData() {
	return L_request({
		url: 'index/index/index',
		method: 'post',
	})
}
export function GetUser() {
	return L_request({
		url: 'admin/Usermanage/getUser',
		// method:'post'
	})
}

export function getmessage() {
	return L_request({
		url: 'index/index/yuxuan',
		method: 'post',
	})
}

export function getManagement(phpUrl, viewData, type = 'post') {//后台权限请求
	return L_request({
		// url:'admin/management/index',
		url: phpUrl,
		method: type,
		data: viewData,
		headers: {
			'Content-type': 'application/x-www-form-urlencoded', //如果post接收空数据就加入这一段
		},
	})
}
//分类
export function Admin_classify(){
  return L_request({
    url:'admin/Classify/selAll',
    method:'get',
    
  })
}

// 分类修改
export function Admin_classifyEdit(id,newName){
  return L_request({
    url:'admin/Classify/edit',
    method:'post',
    data:{id:id,newName:newName}
  })
}
// 分类删除
export function Admin_classifyDel(idList){
  return L_request({
    url:'admin/Classify/del',
    method:'post',
    data:{idList:idList}
  })
}
// 分类添加
export function Adim_classifyAdd(fid,classifyName){
  return L_request({
    url:'admin/Classify/add',
    method:'post',
    data:{fid:fid,nowName:classifyName}
  })
}

// 前台用户反馈
export function Front_Complaint(token,feedCon){
	return L_request({
		url:'index/Complaint/add',
		method:'post',
		data:{token:token,content:feedCon}
	})
}

// 后台获取反馈数据
export function Admin_FeedData(){
	return L_request({
		url:'admin/Feedback/feedselAll',
		method:'get'
	})
}
